package algorithm.greedy.test;

import algorithm.greedy.basic.Coin;
import algorithm.greedy.basic.Pirate;
import algorithm.greedy.basic.knapsack.Article;
import algorithm.greedy.basic.knapsack.Backpack;
import utility.Tools;

/**
 * 项目名称: god
 * 包 名 称: algorithm.greedy.test
 * 类 名 称: Main
 * 类 描 述: TODO
 * 创建时间: 2020/7/13 7:52 上午
 * 创 建 人: Justice
 */
public class Main {
    public static void main(String[] args) {
//        Integer[] random = Tools.random(10, 1, 30);
//        Pirate.test(random, 49);
        // Coin.test2(new Integer[]{1, 5, 20, 25}, 41);
        Backpack.select("价值主导", (Article a1, Article a2) -> a2.value - a1.value);

        Backpack.select("重量主导", (Article a1, Article a2) -> a1.weight - a2.weight);

        Backpack.select("价格密度主导", (Article a1, Article a2) -> Double.compare(a2.valueDensity, a1.valueDensity));
    }
}
